package com.ruicar.afs.cloud.basic.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruicar.afs.cloud.basic.common.condition.DeductionInfoChildCondition;
import com.ruicar.afs.cloud.basic.common.condition.DeductionInfoCondition;
import com.ruicar.afs.cloud.basic.common.condition.QueryCustInfoMultipleCondition;
import com.ruicar.afs.cloud.basic.common.entity.BasicRepaymentPlan;
import com.ruicar.afs.cloud.basic.detail.vo.RentInfoVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author: Lee
 * @date 2020-05-30 04:13:03 
 * @description 
 */
public interface BasicRepaymentPlanMapper extends BaseMapper<BasicRepaymentPlan> {

    /**
     * 根据合同号码查询还款信息
     * @param contractNo
     * @return
     */
    List<RentInfoVO> queryRepaymentInfo(@Param("contractNo")String contractNo,@Param("isOverdue")String isOverdue);

    List<DeductionInfoChildCondition> deductionInfo(@Param("query") QueryCustInfoMultipleCondition condition);

    @Update("update basic_repayment_plan set actual_payment_date = null where contract_no = #{contractNo} and term_no = #{termNo}")
    int updateActualPaymentDate(@Param("contractNo") String contractNo,@Param("termNo") int termNo);

    int getOverdueInfo(@Param("contractNo")String contractNo);

}
